#include "Color4.h"

Color4::Color4() {

}

Color4::Color4( float r, float g, float b, float a /*= 1.f */ ) : r(r), g(g), b(b), a(a) {

}

Color4 Color4::blend( const Color4& colorA, const Color4& colorB, float p ) {
	float q = 1-p;
	return Color4(
		colorA.r * p + colorB.r * q,
		colorA.g * p + colorB.g * q,
		colorA.b * p + colorB.b * q,
		colorA.a * p + colorB.a * q
	);
}

Color4 Color4::gray( float intensity, float a /*= 1.f */ ) {
	return Color4( intensity, intensity, intensity, a );
}
